package actions 
{
	import com.greensock.TweenLite;
	import view.scene.Scene;
	/**
	 * ...
	 * @author Johnny Cheng
	 */
	public class FadeAction 
	{
		public function FadeAction(oldScene:Scene, newScene:Scene) 
		{
			if (oldScene == null) return;
			oldScene.mouseChildren = newScene.mouseChildren = false;
			
			TweenLite.to(oldScene, 0.3, { alpha:0, onComplete:function():void { oldScene.removeSelf(); oldScene.alpha = 1; } } );
			TweenLite.from(newScene, 0.5, { alpha:0, onComplete:function():void { newScene.mouseChildren = true } } );
		}
	}

}